﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Taobao.Tools2.Domain.EntityFramework.Mappings;

namespace Taobao.Tools2.Domain.EntityFramework
{
    public class ItemMapping: ModelMapping<Item>
    {
        public ItemMapping()
            : base()
        {
            Map(d => d.ToTable("Item"));
            Property(c => c.Created).HasColumnName("created");
            Property(c => c.DelistTime).HasColumnName("delist_time");
            //Property(c => c.Desc).HasColumnName("desc");//.HasMaxLength(4000);
            Property(c => c.DetailUrl).HasColumnName("detail_url");//.HasMaxLength(500);
            Property(c => c.EmsFee).HasColumnName("ems_fee");
            Property(c => c.ExpressFee).HasColumnName("express_fee");
            Property(c => c.HasDiscount).HasColumnName("has_discount");
            Property(c => c.HasShowCase).HasColumnName("has_showcase");
            Property(c => c.HasWarranty).HasColumnName("has_warranty");
            Property(c => c.ListTime).HasColumnName("list_time");
            Property(c => c.Modified).HasColumnName("modified");
            Property(c => c.Nick).HasColumnName("nick");
            Property(c => c.Num).HasColumnName("num");
            Property(c => c.NumIID).HasColumnName("num_iid");
            Property(c => c.PicUrl).HasColumnName("pic_url");//.HasMaxLength(500);
            Property(c => c.PostFee).HasColumnName("post_fee");
            Property(c => c.Price).HasColumnName("price");
            Property(c => c.PromotedService).HasColumnName("promoted_service");//.HasMaxLength(500);
            Property(c => c.PropsName).HasColumnName("props_name");//.HasMaxLength(500);
            //Property(c => c.SubStock).HasColumnName("sub_stock");
            Property(c => c.Title).HasColumnName("title");//.HasMaxLength(500);
            Property(c => c.Type).HasColumnName("type");//.HasMaxLength(500);
            Property(c => c.ValidThru).HasColumnName("valid_thru");
            Property(c => c.OuterID).HasColumnName("outer_id"); 

            Property(c => c.ID).HasColumnName("id");
            HasKey(c => c.ID);

            Property(c => c.ShopID).HasColumnName("shop");
            //HasRequired(c => c.Shop).WithOptional().Map(c => c.MapKey("shopid"));
        }
    }
}
